<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vlinker后台管理系统</title>
</head>
<link href="__PUBLIC__/css/bootstrap.css" rel="stylesheet">
<link href="__PUBLIC__/css/public.css" rel="stylesheet">
<link href="__PUBLIC__/css/font-awesome.css" rel="stylesheet">
<link href="__PUBLIC__/layui/css/layui.css" rel="stylesheet">
<script type="text/javascript" src="__PUBLIC__/js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/public.js"></script>
<script type="text/javascript" src="__PUBLIC__/layui/layui.all.js"></script>
<body>
    <!--头部-->
    <div class="login_top">
        <img src="__PUBLIC__/images/i_logo.png">
    </div>
    <div class="login_center">
        <div class="login_main">
            <div class="login_main_title">
                <img src="__PUBLIC__/images/i_denglu.png">
            </div>
            <ul class="clearfix">
                <li style="margin-bottom:20px;">
                    <span>
                        <img src="__PUBLIC__/images/i_zhanghu.png">
                    </span>
                    <input value="" placeholder="请输入账号" name="tel" type="text">
                </li>
                <li>
                    <span>
                        <img src="__PUBLIC__/images/i_mima.png">
                    </span>
                    <input value="" name="password" placeholder="请输入密码" type="password">
                </li>
            </ul>
            <div class="jzmm">
                <!--<a href="forget_password.html">忘记密码</a>-->
                <span><input type="checkbox" name="rember" value="1">记住我</span>
            </div>
            <div class="login_btn">
                <a href="javascript:;">立即登录</a>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        $(function () {
            $('body').bind('keyup', function (event) {
                if (event.keyCode == "13") {
                    //回车执行查询
                    $(".login_btn a").click();
                }
            });

            $(".login_btn a").click(function () {
                var userName= $("input[name='tel']").val();
                var password=$("input[name='password']").val();
                var rember = $('input[name="rember"]').is(':checked');
                if(!userName){
                    layer.msg('用户名不能为空', {icon: 2,time: 1000});
                    return;
                }else if(!password){
                    layer.msg('密码不能为空', {icon: 2,time: 1000});
                    return;
                }

                // 请求登录信息
                var _conf = {'userName':userName,'password':password,'rember':rember};
                $.ajax({
                    type: "POST",
                    url: "{:U('Login/login_post')}",
                    data: _conf,
                    success: function(data){
                        if(data.result == '0'){   // 登陆成功
                            window.location.href = "{:U('Index/index')}";
                        } else {
                            layer.msg(data.msg,{icon:2,time:2000});
                        }
                    },
                    error: function() {
                        layer.msg('服务器异常！',{icon:2,time:2000});
                    },
                });
            })
        });
</script>
    <div class="login_b">
        Copyright@2017.www.vlinker360.com  Rights Rseserced.<a href="http://www.miitbeian.gov.cn/" style="color:#5b5d5a;">苏ICP备16001056号</a>-6版权所有@南京物盟信息技术有限公司
    </div>
</body>
</html>